home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / mathfl / mf_limit.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-12-05  |  3.4 KB  |  121 lines

  1. VERSION 2.00
  2. Begin Form limit 
  3.    Caption         =   "Change Limits"
  4.    ClientHeight    =   2820
  5.    ClientLeft      =   1665
  6.    ClientTop       =   1740
  7.    ClientWidth     =   6585
  8.    Height          =   3225
  9.    Icon            =   MF_LIMIT.FRX:0000
  10.    Left            =   1605
  11.    LinkMode        =   1  'Source
  12.    LinkTopic       =   "Form2"
  13.    ScaleHeight     =   2820
  14.    ScaleWidth      =   6585
  15.    Top             =   1395
  16.    Width           =   6705
  17.    Begin TextBox stud_name 
  18.       FontBold        =   -1  'True
  19.       FontItalic      =   0   'False
  20.       FontName        =   "MS Sans Serif"
  21.       FontSize        =   12
  22.       FontStrikethru  =   0   'False
  23.       FontUnderline   =   0   'False
  24.       Height          =   495
  25.       Left            =   2760
  26.       TabIndex        =   0
  27.       Text            =   " "
  28.       Top             =   240
  29.       Width           =   1575
  30.    End
  31.    Begin SpinButton Spin2 
  32.       Height          =   615
  33.       Left            =   4080
  34.       Top             =   1080
  35.       Width           =   495
  36.    End
  37.    Begin CommandButton Command1 
  38.       Caption         =   "Accept Parameters"
  39.       Default         =   -1  'True
  40.       Height          =   615
  41.       Left            =   2040
  42.       TabIndex        =   2
  43.       Top             =   2040
  44.       Width           =   2055
  45.    End
  46.    Begin Label upper 
  47.       Caption         =   " "
  48.       FontBold        =   -1  'True
  49.       FontItalic      =   0   'False
  50.       FontName        =   "MS Sans Serif"
  51.       FontSize        =   24
  52.       FontStrikethru  =   0   'False
  53.       FontUnderline   =   0   'False
  54.       Height          =   495
  55.       Left            =   2760
  56.       TabIndex        =   5
  57.       Top             =   1080
  58.       Width           =   1215
  59.    End
  60.    Begin Label Label1 
  61.       Caption         =   "Upper limit = 10 draws objects on screen."
  62.       Height          =   615
  63.       Left            =   4800
  64.       TabIndex        =   4
  65.       Top             =   1080
  66.       Width           =   1695
  67.    End
  68.    Begin Label Label3 
  69.       Caption         =   "Enter Student Name Here"
  70.       Height          =   255
  71.       Left            =   240
  72.       TabIndex        =   3
  73.       Top             =   240
  74.       Width           =   2295
  75.    End
  76.    Begin Label Label2 
  77.       Caption         =   "Upper Limit of Numbers"
  78.       Height          =   255
  79.       Left            =   360
  80.       TabIndex        =   1
  81.       Top             =   1200
  82.       Width           =   2295
  83.    End
  84. Sub Command1_Click ()
  85.     If stud_name.Text = "" Then
  86.         MsgBox "Please enter a name for the student."
  87.         limit.Show
  88.         stud_name.SetFocus
  89.         Exit Sub
  90.     End If
  91.     student_name = LTrim$(stud_name.Text)
  92.     upper_limit = Val(upper.Caption)
  93.     main.Show
  94. End Sub
  95. Sub form_load ()
  96. If upper_limit = 0 Then
  97.     upper.Caption = "10"
  98.     upper.Caption = Str$(upper_limit)
  99. End If
  100. If student_name <> " " Then
  101.     stud_name.Text = student_name
  102. End If
  103. End Sub
  104. Sub Spin2_SpinDown ()
  105. upper.Caption = Str$(Val(upper.Caption) - 10)
  106. If Val(upper.Caption) < 10 Then
  107.     upper.Caption = " 10"
  108. End If
  109. upper.Refresh
  110. End Sub
  111. Sub Spin2_SpinUp ()
  112. upper.Caption = Str$(Val(upper.Caption) + 10)
  113. If Val(upper.Caption) = 110 Then
  114.     upper.Caption = " 100"
  115. End If
  116. upper.Refresh
  117. End Sub
  118. Sub upper_GotFocus ()
  119. stud_name.SetFocus
  120. End Sub
  121.